package org.huzhp.console.core;

/**
 * @Description: 网关断言枚举
 * @Author: huzp
 * @CreateDate: 2020/3/19 15:48
 * @Version: 1.0
 */
public enum GatewayPreDicateEnum {

    AFTER("After", "时间后", new String[]{"时间格式字符串"}, 0),
    BEFORE("Before", "时间前", new String[]{"时间格式字符串"}, 0),
    BETWEEN("Between", "时间之前", new String[]{"时间格式字符串", "时间格式字符串"}, 0),
    COOKIE("Cookie", "包含Cookie信息", new String[]{"Cookie的key", "Cookie的value"}, 0),
    HEADER("Header", "包含Header信息", new String[]{"请求头的key", "请求头的value"}, 0),
    HOST("Host", "请求主机", new String[]{"请求来源主机"}, 0),
    METHOD("Method", "请求方法", new String[]{"请求方式(GET/POST...)"}, 0),
    PATH("Path", "请求路径", new String[]{"请求地址,可以通配符"}, 1),
    QUERY("Query", "请求参数", new String[]{"查询参数的key", "查询参数的value"}, 0),
    WEIGHT("Weight", "权重", new String[]{"路由组", "权重值"}, 0),
    REMOTEADDR("RemoteAddr", "远程地址", new String[]{"远程地址"}, 0),;

    /**
     * 断言名称
     */
    private String name;

    /**
     * 过滤器描述
     */
    private String desc;
    /**
     * 参数描述
     */
    private String[] args;

    private int common;

    GatewayPreDicateEnum(String name, String desc, String[] args, int common) {
        this.name = name;
        this.desc = desc;
        this.args = args;
        this.common = common;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String[] getArgs() {
        return args;
    }

    public void setArgs(String[] args) {
        this.args = args;
    }

    public int getCommon() {
        return common;
    }

    public void setCommon(int common) {
        this.common = common;
    }
}
